package com.ce.pms.system.occupation.web;

import java.util.ArrayList;
import java.util.List;

import com.ce.pms.base.vo.SearchVO;
import com.ce.pms.base.web.PmsBaseAction;
import com.ce.pms.charge.service.IBusinessCodeService;
import com.ce.pms.charge.vo.BusinessCodeVO;
import com.ce.pms.exception.BusinessException;
import com.ce.pms.system.occupation.service.IAbsentDocumentItemConfigService;
import com.ce.pms.system.occupation.service.IContractorInfoConfigService;
import com.ce.pms.system.occupation.service.IOccupationChargeItemConfigService;
import com.ce.pms.system.occupation.service.IPerfectItemTypeConfigService;
import com.ce.pms.system.occupation.service.ISendDocumentItemConfigService;
import com.ce.pms.system.occupation.service.IThingHandoverCongfigService;
import com.ce.pms.system.occupation.vo.AbsentDocumentItemConfigVO;
import com.ce.pms.system.occupation.vo.ContractorInfoConfigVO;
import com.ce.pms.system.occupation.vo.OccupationChargeItemConfigVO;
import com.ce.pms.system.occupation.vo.PerfectItemTypeConfigVO;
import com.ce.pms.system.occupation.vo.SendDocumentItemConfigVO;
import com.ce.pms.system.occupation.vo.ThingHandoverCongfigVO;
import com.ce.util.BlankUtil;
import com.sitechasia.webx.core.annotation.Read;
import com.sitechasia.webx.core.support.Page;

/**
 * 入伙设置
 *
 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
 * @Created 2008-12-30
 */
public class OccupationConfigAction extends PmsBaseAction {

	/**
	 * 入伙资料缺失
	 */
	private IAbsentDocumentItemConfigService	absentDocumentItemConfigService;

	private IBusinessCodeService				businessCodeService;

	private IContractorInfoConfigService		contractorInfoConfigService;

	/**
	 * 入伙缴费设置
	 */
	private IOccupationChargeItemConfigService	occupationChargeItemConfigService;

	private IPerfectItemTypeConfigService		perfectItemTypeConfigService;

	private ISendDocumentItemConfigService		sendDocumentItemConfigService;

	/**
	 * 物品移交登记
	 */
	private IThingHandoverCongfigService		thingHandoverCongfigService;

	/**
	 * 功能描述: 新增承包商<br>
	 *
	 * @param configVO Create author:yandawei <br>
	 *            Create on:2008-12-30 <br>
	 *            Edit author: <br>
	 *            Edit on: <br>
	 *            Why: <br>
	 */
	public void addContractorConfig(@Read ContractorInfoConfigVO configVO) {
		configVO.setCreator(this.getUserId());
		this.contractorInfoConfigService.addContractorInfoConfig(configVO);
		this.renderText("true");
	}

	/**
	 * 功能描述: 新增申报项目类型<br>
	 *
	 * @param configVO Create author:yandawei <br>
	 *            Create on:2008-12-30 <br>
	 *            Edit author: <br>
	 *            Edit on: <br>
	 *            Why: <br>
	 */
	public void addDeclareType(@Read PerfectItemTypeConfigVO configVO) {
		configVO.setCreator(this.getUserId());
		this.perfectItemTypeConfigService.addPerfectItemTypeConfig(configVO);
		this.renderText("true");
	}

	/**
	 * 功能描述: 新增发放资料<br>
	 *
	 * @param configVO Create author:yandawei <br>
	 *            Create on:2008-12-30 <br>
	 *            Edit author: <br>
	 *            Edit on: <br>
	 *            Why: <br>
	 */
	public void addSendDoc(@Read SendDocumentItemConfigVO configVO) {
		configVO.setCreator(this.getUserId());
		this.sendDocumentItemConfigService.addSendDocumentItemConfig(configVO);
		this.renderText("true");

	}

	/**
	 * 物品移交登记添加或编辑页面
	 *
	 * @param keyword
	 * @return
	 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
	 * @created 2008-12-30
	 */
	public String articleTransferEditPage(@Read(key = "keyword") Long keyword) {
		if (!BlankUtil.isBlank(keyword)) {
			ThingHandoverCongfigVO thingHandoverCongfigVO = this.thingHandoverCongfigService
					.findThingHandoverCongfigVOById(keyword);
			this.setAttribute("thingHandoverCongfigVO", thingHandoverCongfigVO);
		}

		return "articleTransferConfigEdit";
	}

	/**
	 * 物品移交登记列表
	 *
	 * @return
	 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
	 * @created 2008-12-30
	 */
	@SuppressWarnings("unchecked")
	public String articleTransferListPage(
			@Read(key = "ec_p", defaultValue = "1") Integer pageNO,
			@Read(key = "ec_crd", defaultValue = "15") Integer pageSize) {
		SearchVO searchVo = new SearchVO();
		searchVo.setPageNo(pageNO);
		searchVo.setPageSize(pageSize);

		Page page = this.thingHandoverCongfigService
				.queryThingHandoverCongfigListByPage(this.getLoginUser());

		List<ThingHandoverCongfigVO> list = page.getResult();
		this.setAttribute("queryDataList", list);
		this.setAttribute("totalRows", Long.valueOf(page.getTotalCount())
				.intValue());
		return "articleTransferConfigList";
	}

	/**
	 * 缴费设置添加或编辑页面
	 *
	 * @param keyword
	 * @return
	 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
	 * @created 2008-12-30
	 */
	public String chargeEditPage(@Read(key = "keyword") Long keyword) {
		List<BusinessCodeVO> businessCodeList = this.occupationChargeItemConfigService
				.getBusinessCodeList();
		this.setAttribute("businessCodeList", businessCodeList);
		if (!BlankUtil.isBlank(keyword)) {
			OccupationChargeItemConfigVO occupationChargeItemConfigVO = this.occupationChargeItemConfigService
					.findOccupationChargeItemConfigVOById(keyword);
			this.setAttribute("occupationChargeItemConfigVO",
					occupationChargeItemConfigVO);
		}
		return "chargeConfigEdit";
	}

	/**
	 *
	 * 缴费设置列表
	 *
	 * @param pageNO
	 * @param pageSize
	 * @return
	 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
	 * @created 2008-12-30
	 */
	@SuppressWarnings("unchecked")
	public String chargeListPage(
			@Read(key = "ec_p", defaultValue = "1") Integer pageNO,
			@Read(key = "ec_crd", defaultValue = "15") Integer pageSize) {
		SearchVO searchVo = new SearchVO();
		searchVo.setPageNo(pageNO);
		searchVo.setPageSize(pageSize);

		Page page = this.occupationChargeItemConfigService
				.queryOccupationChargeItemConfigListByPage(searchVo);
		List<OccupationChargeItemConfigVO> tmpList = page.getResult();
		List<OccupationChargeItemConfigVO> list = new ArrayList<OccupationChargeItemConfigVO>();
		// TODO 数据处理预留
		for (OccupationChargeItemConfigVO occupationChargeItemConfigVO : tmpList) {
			if ("1".equals(occupationChargeItemConfigVO.getPayTransferYn())) {
				occupationChargeItemConfigVO.setPayTransferYn("跟进");
			} else {
				occupationChargeItemConfigVO.setPayTransferYn("不跟进");
			}

			if ("1".equals(occupationChargeItemConfigVO.getStopYn())) {
				occupationChargeItemConfigVO.setStopYn("在用");
			} else {
				occupationChargeItemConfigVO.setStopYn("停用");
			}

			if ("001".equals(occupationChargeItemConfigVO.getPayMode())) {
				occupationChargeItemConfigVO.setPayMode("按固定金额计费");
			} else {
				occupationChargeItemConfigVO.setPayMode("按建筑面积计费");
			}

			list.add(occupationChargeItemConfigVO);
		}

		this.setAttribute("queryDataList", list);
		this.setAttribute("totalRows", Long.valueOf(page.getTotalCount())
				.intValue());

		return "chargeConfigList";
	}

	/**
	 * 功能描述: 验证承包商唯一性<br>
	 *
	 * @param name Create author:yandawei <br>
	 *            Create on:2008-12-31 <br>
	 *            Edit author: <br>
	 *            Edit on: <br>
	 *            Why: <br>
	 */
	public void checkUniqueContractorName(
			@Read(key = "contractorInfoName") String name) {
		String result = null;
		try {
			this.contractorInfoConfigService.checkExistenceByName(name);
			result = "true";
		} catch (Exception e) {
			result = "承包商名已存在";
		}
		this.renderText(result);
	}

	/**
	 * 功能描述: 验证申报项目唯一性 <br>
	 *
	 * @param name Create author:yandawei <br>
	 *            Create on:2008-12-31 <br>
	 *            Edit author: <br>
	 *            Edit on: <br>
	 *            Why: <br>
	 */
	public void checkUniqueDeclareName(
			@Read(key = "perfectItemTypeName") String name) {
		String result = null;
		try {
			this.perfectItemTypeConfigService.checkExistenceByName(name);
			result = "true";
		} catch (Exception e) {
			result ="申报项目类型已存在";
		}
		this.renderText(result);
	}

	/**
	 * 功能描述: 验证发放资料唯一性<br>
	 *
	 * @param name Create author:yandawei <br>
	 *            Create on:2008-12-31 <br>
	 *            Edit author: <br>
	 *            Edit on: <br>
	 *            Why: <br>
	 */
	public void checkUniqueSendDocName(
			@Read(key = "sendDocumentItemName") String name) {
		String result = null;
		try {
			this.sendDocumentItemConfigService.checkExistenceByName(name);
			result = "true";
		} catch (Exception e) {
			result = "资料名称已存在";
		}
		this.renderText(result);
	}

	/**
	 * 物品移交登记删除记录
	 *
	 * @param keyword 主键
	 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
	 * @created 2008-12-30
	 */
	public void deleteArticleTransfer(@Read(key = "keyword") Long keyword) {
		try {
			this.thingHandoverCongfigService
					.deleteThingHandoverCongfigById(keyword);
			this.renderText("true");
		} catch (RuntimeException re) {
			throw new BusinessException(
					"occupation:system_delete_inused_exception",
					BusinessException.WARNING);
		}
	}

	/**
	 * 删除缴费设置
	 *
	 * @param keyword
	 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
	 * @created 2008-12-30
	 */
	public void deleteCharge(@Read(key = "keyword") Long keyword) {
		try {
			this.occupationChargeItemConfigService
					.deleteOccupationChargeItemConfigById(keyword);

			this.renderText("true");
		} catch (RuntimeException re) {
			throw new BusinessException(
					"occupation:system_delete_inused_exception",
					BusinessException.WARNING);
		}
	}

	/**
	 * 功能描述: 删除承包商<br>
	 *
	 * @param id Create author:yandawei <br>
	 *            Create on:2008-12-30 <br>
	 *            Edit author: <br>
	 *            Edit on: <br>
	 *            Why: <br>
	 */
	public void deleteContractorConfig(@Read(key = "id") Long id) {
		try{
			this.contractorInfoConfigService.deleteContractorInfoConfigById(id);
			this.renderText("true");
		}catch(Exception e){
			throw new BusinessException("occupation:system_delete_inused_exception",BusinessException.FAILURE);
		}
	}

	/**
	 * 功能描述: 删除申报项目类型<br>
	 *
	 * @param id Create author:yandawei <br>
	 *            Create on:2008-12-30 <br>
	 *            Edit author: <br>
	 *            Edit on: <br>
	 *            Why: <br>
	 */
	public void deleteDeclareType(@Read(key = "id") Long id) {
		try{
			this.perfectItemTypeConfigService.deletePerfectItemTypeConfigById(id);
			this.renderText("true");
		}catch(Exception e){
			throw new BusinessException("occupation:system_delete_inused_exception",BusinessException.FAILURE);
		}
	}

	/**
	 * 删除缺失资料
	 *
	 * @param keyword
	 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
	 * @created 2008-12-30
	 */
	public void deleteMissingInformation(@Read(key = "keyword") Long keyword) {
		try {
			this.absentDocumentItemConfigService
					.deleteAbsentDocumentItemConfigById(keyword);
			this.renderText("true");
		} catch (RuntimeException re) {
			throw new BusinessException(
					"occupation:system_delete_inused_exception",
					BusinessException.WARNING);
		}
	}

	/**
	 * 功能描述: 删除发放资料<br>
	 *
	 * @param id Create author:yandawei <br>
	 *            Create on:2008-12-30 <br>
	 *            Edit author: <br>
	 *            Edit on: <br>
	 *            Why: <br>
	 */
	public void deleteSendDoc(@Read(key = "id") Long id) {
		try{
			this.sendDocumentItemConfigService.deleteSendDocumentItemConfigById(id);
			this.renderText("true");
		}catch(Exception e){
			throw new BusinessException("occupation:system_delete_inused_exception",BusinessException.FAILURE);
		}
	}

	/**
	 * 物品移交登记添加或编辑
	 *
	 * @param thingHandoverCongfigVO
	 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
	 * @created 2008-12-30
	 */
	public void editArticleTransfer(
			@Read ThingHandoverCongfigVO thingHandoverCongfigVO) {
		try {
			if (BlankUtil.isBlank(thingHandoverCongfigVO.getKeyword())
					|| thingHandoverCongfigVO.getKeyword() == 0) {
				thingHandoverCongfigVO.setCreator(this.getUserId());
				this.thingHandoverCongfigService
						.addThingHandoverCongfig(thingHandoverCongfigVO);
			} else {
				thingHandoverCongfigVO.setModifier(this.getUserId());
				this.thingHandoverCongfigService
						.editThingHandoverCongfig(thingHandoverCongfigVO);
			}
			this.renderText("true");
		} catch (RuntimeException re) {
			throw re;
		}

	}

	/**
	 * 添加或编辑收费设置
	 *
	 * @param occupationChargeItemConfigVO
	 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
	 * @created 2008-12-30
	 */
	public void editCharge(
			@Read OccupationChargeItemConfigVO occupationChargeItemConfigVO) {
		try {
			if (occupationChargeItemConfigVO.getMonthPayYn() == null) {
				occupationChargeItemConfigVO.setMonthPayYn("0");
			}
			if (BlankUtil.isBlank(occupationChargeItemConfigVO.getKeyword())
					|| occupationChargeItemConfigVO.getKeyword() == 0) {
				occupationChargeItemConfigVO.setCreator(this.getUserId());
				this.occupationChargeItemConfigService
						.addPerfectItemTypeConfig(occupationChargeItemConfigVO);
			} else {
				occupationChargeItemConfigVO.setModifier(this.getUserId());
				this.occupationChargeItemConfigService
						.editOccupationChargeItemConfig(occupationChargeItemConfigVO);
			}
			this.renderText("true");
		} catch (RuntimeException re) {
			throw re;
		}
	}

	/**
	 * 功能描述: 修改承包商<br>
	 *
	 * @param configVO Create author:yandawei <br>
	 *            Create on:2008-12-30 <br>
	 *            Edit author: <br>
	 *            Edit on: <br>
	 *            Why: <br>
	 */
	public void editContractorConfig(@Read ContractorInfoConfigVO configVO) {
		configVO.setModifier(this.getUserId());
		this.contractorInfoConfigService.editContractorInfoConfig(configVO);
		this.renderText("true");
	}

	/**
	 * 功能描述: 修改申报项目类型<br>
	 *
	 * @param configVO Create author:yandawei <br>
	 *            Create on:2008-12-30 <br>
	 *            Edit author: <br>
	 *            Edit on: <br>
	 *            Why: <br>
	 */
	public void editDeclareType(@Read PerfectItemTypeConfigVO configVO) {
		configVO.setModifier(this.getUserId());
		this.perfectItemTypeConfigService.editPerfectItemTypeConfig(configVO);
		this.renderText("true");
	}

	/**
	 * 添加或编辑缺失资料
	 *
	 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
	 * @created 2008-12-30
	 */
	public void editMissingInformation(
			@Read AbsentDocumentItemConfigVO absentDocumentItemConfigVO) {
		try {
			if (BlankUtil.isBlank(absentDocumentItemConfigVO.getKeyword())
					|| absentDocumentItemConfigVO.getKeyword() == 0) {
				absentDocumentItemConfigVO.setCreator(this.getUserId());
				this.absentDocumentItemConfigService
						.addAbsentDocumentItemConfig(absentDocumentItemConfigVO);
			} else {
				absentDocumentItemConfigVO.setModifier(this.getUserId());
				this.absentDocumentItemConfigService
						.editAbsentDocumentItemConfig(absentDocumentItemConfigVO);
			}
			this.renderText("true");
		} catch (RuntimeException re) {
			throw re;
		}


	}

	/**
	 * 功能描述: 修改发放资料<br>
	 *
	 * @param configVO Create author:yandawei <br>
	 *            Create on:2008-12-30 <br>
	 *            Edit author: <br>
	 *            Edit on: <br>
	 *            Why: <br>
	 */
	public void editSendDoc(@Read SendDocumentItemConfigVO configVO) {
		configVO.setModifier(this.getUserId());
		this.sendDocumentItemConfigService.editSendDocumentItemConfig(configVO);
		this.renderText("true");
	}

	/**
	 * 获取交易码ID的说明
	 *
	 * @param businessCodeId
	 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
	 * @created 2009-1-16
	 */
	public void getBusinessCodeDescription(
			@Read(key = "businessCodeId") Long businessCodeId,
			@Read(key = "isDescription") boolean isDescription) {

		BusinessCodeVO businessCodeVO = this.businessCodeService
				.findBusinessCodeByKeyword(businessCodeId);
		if (businessCodeVO != null) {
			if (isDescription) {
				this.renderText(businessCodeVO.getDescription());
			} else {
				this.renderText(businessCodeVO.getBizCode());
			}
		} else {
			this.renderText("false");
		}
	}

	/**
	 * 功能描述: 初始化承包商新增页面<br>
	 *
	 * @return Create author:yandawei <br>
	 *         Create on:2008-12-30 <br>
	 *         Edit author: <br>
	 *         Edit on: <br>
	 *         Why: <br>
	 */
	public String initContractorConfigAdd() {
		this.setAttribute("flag", "add");
		return "contractConfigEdit";
	}

	/**
	 * 功能描述: 初始化承包商修改页面<br>
	 *
	 * @param id
	 * @return Create author:yandawei <br>
	 *         Create on:2008-12-30 <br>
	 *         Edit author: <br>
	 *         Edit on: <br>
	 *         Why: <br>
	 */
	public String initContractorConfigEdit(@Read(key = "id") Long id) {
		ContractorInfoConfigVO configVO = this.contractorInfoConfigService
				.findObjectVOById(id);
		this.setAttribute("contractor", configVO);
		this.setAttribute("flag", "update");
		return "contractConfigEdit";
	}

	/**
	 * 功能描述: 初始化承包商列表<br>
	 *
	 * @return Create author:yandawei <br>
	 *         Create on:2008-12-30 <br>
	 *         Edit author: <br>
	 *         Edit on: <br>
	 *         Why: <br>
	 */
	public String initContractorConfigList(
			@Read(key = "ec_p", defaultValue = "1") Integer pageNO,
			@Read(key = "ec_crd", defaultValue = "15") Integer pageSize) {
		SearchVO search = new SearchVO();
		search.setPageNo(pageNO);
		search.setPageSize(pageSize);
		Page page = this.contractorInfoConfigService
				.queryContractorInfoConfigListByPage(search);
		if (!BlankUtil.isBlank(page)) {
			this.setAttribute("contractorList", page.getResult());
			this.setAttribute("totalRows", Integer.valueOf(String.valueOf(page
					.getTotalCount())));
		} else {
			this.setAttribute("totalRows", new Integer(0));
		}
		return "contractorConfigList";
	}

	/**
	 * 功能描述: 初始化申报项目类型新增页面<br>
	 *
	 * @return Create author:yandawei <br>
	 *         Create on:2008-12-30 <br>
	 *         Edit author: <br>
	 *         Edit on: <br>
	 *         Why: <br>
	 */
	public String initDeclareTypeAdd() {
		this.setAttribute("flag", "add");
		return "declareTypeConfigEdit";
	}

	/**
	 * 功能描述: 初始化申报项目类型修改页面<br>
	 *
	 * @param id
	 * @return Create author:yandawei <br>
	 *         Create on:2008-12-30 <br>
	 *         Edit author: <br>
	 *         Edit on: <br>
	 *         Why: <br>
	 */
	public String initDeclareTypeEdit(@Read(key = "id") Long id) {
		PerfectItemTypeConfigVO configVO = this.perfectItemTypeConfigService
				.findObjectVOById(id);
		this.setAttribute("declareType", configVO);
		this.setAttribute("flag", "update");
		return "declareTypeConfigEdit";
	}

	/**
	 * 功能描述: 初始化申报项目类型列表<br>
	 *
	 * @return Create author:yandawei <br>
	 *         Create on:2008-12-30 <br>
	 *         Edit author: <br>
	 *         Edit on: <br>
	 *         Why: <br>
	 */
	public String initDeclareTypeList(
			@Read(key = "ec_p", defaultValue = "1") Integer pageNO,
			@Read(key = "ec_crd", defaultValue = "15") Integer pageSize) {
		SearchVO search = new SearchVO();
		search.setPageNo(pageNO);
		search.setPageSize(pageSize);
		Page page = this.perfectItemTypeConfigService
				.queryPerfectItemTypeConfigListByPage(search);
		if (!BlankUtil.isBlank(page)) {
			this.setAttribute("declareTypeList", page.getResult());
			this.setAttribute("totalRows", Integer.valueOf(String.valueOf(page
					.getTotalCount())));
		} else {
			this.setAttribute("totalRows", new Integer(0));
		}
		return "declareTypeConfigList";
	}

	/**
	 * 功能描述: 入伙设置主页面 <br>
	 *
	 * @return Create author:yandawei <br>
	 *         Create on:2008-12-30 <br>
	 *         Edit author: <br>
	 *         Edit on: <br>
	 *         Why: <br>
	 */
	public String initOccupationConfigMain() {
		return "baseSettingsMain";
	}

	/**
	 * 功能描述: 初始化发放资料新增页面<br>
	 *
	 * @return Create author:yandawei <br>
	 *         Create on:2008-12-30 <br>
	 *         Edit author: <br>
	 *         Edit on: <br>
	 *         Why: <br>
	 */
	public String initSendDocAdd() {
		this.setAttribute("flag", "add");
		return "sendDocumentConfigEdit";
	}

	/**
	 * 功能描述: 初始化发放资料修改页面<br>
	 *
	 * @param id
	 * @return Create author:yandawei <br>
	 *         Create on:2008-12-30 <br>
	 *         Edit author: <br>
	 *         Edit on: <br>
	 *         Why: <br>
	 */
	public String initSendDocEdit(@Read(key = "id") Long id) {
		SendDocumentItemConfigVO configVO = this.sendDocumentItemConfigService
				.findObjectVOById(id);
		this.setAttribute("sendDoc", configVO);
		this.setAttribute("flag", "update");
		return "sendDocumentConfigEdit";
	}

	/**
	 * 功能描述: 初始化发放资料列表<br>
	 *
	 * @return Create author:yandawei <br>
	 *         Create on:2008-12-30 <br>
	 *         Edit author: <br>
	 *         Edit on: <br>
	 *         Why: <br>
	 */
	public String initSendDocList(
			@Read(key = "ec_p", defaultValue = "1") Integer pageNO,
			@Read(key = "ec_crd", defaultValue = "15") Integer pageSize) {
		SearchVO search = new SearchVO();
		search.setPageNo(pageNO);
		search.setPageSize(pageSize);
		Page page = this.sendDocumentItemConfigService
				.querySendDocumentItemConfigListByPage(search);
		if (!BlankUtil.isBlank(page)) {
			this.setAttribute("sendDocumentList", page.getResult());
			this.setAttribute("totalRows", Integer.valueOf(String.valueOf(page
					.getTotalCount())));
		} else {
			this.setAttribute("totalRows", new Integer(0));
		}
		return "sendDocumentConfigList";
	}

	/**
	 * 入伙资料缺失添加或编辑页面
	 *
	 * @param keyword
	 * @return
	 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
	 * @created 2008-12-30
	 */
	public String missingInformationEditPage(@Read(key = "keyword") Long keyword) {
		if (!BlankUtil.isBlank(keyword)) {
			AbsentDocumentItemConfigVO absentDocumentItemConfigVO = this.absentDocumentItemConfigService
					.findObjectVOById(keyword);
			this.setAttribute("absentDocumentItemConfigVO",
					absentDocumentItemConfigVO);
		}

		return "missingInformationConfigEdit";
	}

	/**
	 * 入伙资料缺失列表页面
	 *
	 * @param pageNO
	 * @param pageSize
	 * @return
	 * @author <a href="mailto:i0o@live.cn">黄腾飞</a>
	 * @created 2008-12-30
	 */
	@SuppressWarnings("unchecked")
	public String missingInformationListPage(
			@Read(key = "ec_p", defaultValue = "1") Integer pageNO,
			@Read(key = "ec_crd", defaultValue = "15") Integer pageSize) {
		SearchVO searchVo = new SearchVO();
		searchVo.setPageNo(pageNO);
		searchVo.setPageSize(pageSize);

		Page page = this.absentDocumentItemConfigService
				.queryAbsentDocumentItemConfigListByPage(searchVo);

		List<AbsentDocumentItemConfigVO> list = page.getResult();
		// TODO 数据处理逻辑预留

		this.setAttribute("queryDataList", list);
		this.setAttribute("totalRows", Long.valueOf(page.getTotalCount())
				.intValue());

		return "missingInformationConfigList";
	}

	/**
	 * @param absentDocumentItemConfigService the
	 *            absentDocumentItemConfigService to set
	 */
	public void setAbsentDocumentItemConfigService(
			IAbsentDocumentItemConfigService absentDocumentItemConfigService) {
		this.absentDocumentItemConfigService = absentDocumentItemConfigService;
	}

	/**
	 * @param businessCodeService the businessCodeService to set
	 */
	public void setBusinessCodeService(IBusinessCodeService businessCodeService) {
		this.businessCodeService = businessCodeService;
	}

	public void setContractorInfoConfigService(
			IContractorInfoConfigService contractorInfoConfigService) {
		this.contractorInfoConfigService = contractorInfoConfigService;
	}

	/**
	 * @param occupationChargeItemConfigService the
	 *            occupationChargeItemConfigService to set
	 */
	public void setOccupationChargeItemConfigService(
			IOccupationChargeItemConfigService occupationChargeItemConfigService) {
		this.occupationChargeItemConfigService = occupationChargeItemConfigService;
	}

	public void setPerfectItemTypeConfigService(
			IPerfectItemTypeConfigService perfectItemTypeConfigService) {
		this.perfectItemTypeConfigService = perfectItemTypeConfigService;
	}

	public void setSendDocumentItemConfigService(
			ISendDocumentItemConfigService sendDocumentItemConfigService) {
		this.sendDocumentItemConfigService = sendDocumentItemConfigService;
	}

	/**
	 * @param thingHandoverCongfigService the thingHandoverCongfigService to set
	 */
	public void setThingHandoverCongfigService(
			IThingHandoverCongfigService thingHandoverCongfigService) {
		this.thingHandoverCongfigService = thingHandoverCongfigService;
	}

}
